<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@page import="java.util.List"%>
    <%@page import="org.jmu.entity.Topic"%>
<!DOCTYPE html>
<html>
<%  
String path = request.getContextPath();  
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";  
%>  
<base href="<%=basePath%>">
<head>
  <meta charset="utf-8">
  <title>Layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="<%=path%>/views/static/layui-v2.5.6/layui/css/layui.css"  media="all">
	  <style type="text/css">
 .a-upload {
    padding: 4px 10px;
    height: 20px;
    line-height: 20px;
    position: relative;
    cursor: pointer;
    color: #888;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    display: inline-block;
    *display: inline;
    *zoom: 1
}

.a-upload  input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
    filter: alpha(opacity=0);
    cursor: pointer
}

.a-upload:hover {
    color: #444;
    background: #eee;
    border-color: #ccc;
    text-decoration: none
}
  </style>
</head>
<body id="bd" background="views/static/imgs/admin_bg.jpg" style="background-repeat: no-repeat;background-size: 100% 100%;background-attachment: fixed;">

<div class="site-demo-button" id="layerDemo" style="margin-bottom: 0;">
  <button data-method="notice" class="layui-btn layui-btn-radius" onclick="window.location.href='views/static/background.html'" style="position:absolute;left: 7px;top: 7px;"><i class="layui-icon"></i>返回首页</button>
</div>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
  <legend>帖子信息中心</legend>
</fieldset>
 
   
   
    		<div class="layui-form">
  <table class="layui-table">
    <colgroup>
      <col width="100">
      <col width="100">
      <col width="150">
      <col width="100">
      <col width="150">
      <col width="100">
    </colgroup>
    <thead>
      <tr>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">发帖人</span></th>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">帖子标题</span></th>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">发布时间</span></th>
        <th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">所属版块</span></th>
      	<th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">帖子内容</span></th>
      	<th><span style="font-size: large;font-weight: bolder;font-family: 宋体;">操作</span></th>
      </tr> 
    </thead>
    <tbody>
    <%List<Topic> topiclist = (List)session.getAttribute("topiclist");%>
    <%if(topiclist.size()>0){ %>
    <%for(int i=0;i<topiclist.size();i++){ %>
      <tr>
        <td><%=topiclist.get(i).getAuthor_name() %></td>
        <td><%=topiclist.get(i).getTitle() %></td>
        <td><%=topiclist.get(i).getCreate_time() %></td>
        <td><%=topiclist.get(i).getSort_topic() %></td>
        <td><%=topiclist.get(i).getContent() %></td>
        <td><a href="controller/deleteTopicbytitle1?title=<%=topiclist.get(i).getTitle() %>"><span class="layui-badge">删除帖子</span></a></td>
      </tr>
      <%} %>
      <%} %>
      
    </tbody>
  </table>
</div>
  	

   
       
<script src="<%=path%>/views/static/layui-v2.5.6/layui/layui.all.js" charset="utf-8"></script>
<script>
layui.use('element', function(){
  var $ = layui.jquery
  ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
  
  //触发事件
  var active = {
    tabAdd: function(){
      //新增一个Tab项
      element.tabAdd('demo', {
        title: '新选项'+ (Math.random()*1000|0) //用于演示
        ,content: '内容'+ (Math.random()*1000|0)
        ,id: new Date().getTime() //实际使用一般是规定好的id，这里以时间戳模拟下
      })
    }
    ,tabDelete: function(othis){
      //删除指定Tab项
      element.tabDelete('demo', '44'); //删除：“商品管理”
      
      
      othis.addClass('layui-btn-disabled');
    }
    ,tabChange: function(){
      //切换到指定Tab项
      element.tabChange('demo', '22'); //切换到：用户管理
    }
  };
  
  $('.site-demo-active').on('click', function(){
    var othis = $(this), type = othis.data('type');
    active[type] ? active[type].call(this, othis) : '';
  });
  
  
  
});
</script>

<script>
layui.use('layer', function(){ //独立版的layer无需执行这一句
  var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
  
  //触发事件
  var active = {
    notice: function(){
      //示范一个公告层
      layer.open({
        type: 1
        ,title: false //不显示标题栏
        ,closeBtn: false
        ,area: '300px;'
        ,shade: 0.5
        ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
        ,btn: ['是的，确定', '再考虑考虑']
        ,btnAlign: 'c'
        ,moveType: 1 //拖拽模式，0或者1
        ,content: '<div style="padding: 50px; line-height: 22px; background-color: white; color:black; font-weight: 400;font-size:18px;">真的要清除所有的历史记录吗？</div>'
        ,success: function(layero){
          var btn = layero.find('.layui-layer-btn');
          btn.find('.layui-layer-btn0').attr({
            href: 'user_basic.jsp'
            
          });
        }
      });
    }
  };
  
  $('#layerDemo .layui-btn').on('click', function(){
    var othis = $(this), method = othis.data('method');
    active[method] ? active[method].call(this, othis) : '';
  });
  
});
</script>

</body>
</html>